<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Filter</title>
</head>
<body>
<h2>敏感词过滤</h2>
<p>
    <textarea name="" id="area" cols="30" rows="10"></textarea>
</p>

<p>
    <input type="submit" value="发布" id="input">
</p>
<p id="res"></p>
<script>
    document.getElementById('input').onclick=function () {
        let data=document.getElementById("area").value;
        let key=/金三胖|妈的|fuck/g;
        let newvalue=data.replace(key,'*')
        document.getElementById('res').innerText=newvalue;
    }

</script>
</body>
</html>